<?php

require 'Ip2Region.php';

$ip2region = new Ip2Region();

// https://api.13log.cn/ip/?resp=js&ip=

$ip = $_GET['ip'];

echo PHP_EOL . "document.write(" . PHP_EOL;
$ret = $ip2region->simple($ip);
$arr = explode('【', $ret);
var_export($arr[0]);
echo PHP_EOL . ")" . PHP_EOL . PHP_EOL;
